package com.ihr360.payroll.model.dto.salary.meta;

import com.ihr360.commons.model.IIntIndexableEntity;
import com.ihr360.commons.model.INamedEntity;
import com.ihr360.commons.model.entity.NumberId;
import com.ihr360.payroll.model.meta.PropertyMeta;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * （不定项）员工属性表
 */
@Entity
public class StaffPropField extends NumberId<Long> implements INamedEntity,IIntIndexableEntity{

    protected int indexno;

    @Column(nullable = false)
    protected String name;

    /** 工资表配置 */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(nullable = false)
    protected PayrollConfig config;

    /** 工资表配置 */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(nullable = false)
    protected PropertyMeta propertyMeta;

    public PayrollConfig getConfig() {
        return config;
    }

    public void setConfig(PayrollConfig config) {
        this.config = config;
    }

    public PropertyMeta getPropertyMeta() {
        return propertyMeta;
    }

    public void setPropertyMeta(PropertyMeta propertyMeta) {
        this.propertyMeta = propertyMeta;
    }

    @Override
    public int getIndexno() {
        return indexno;
    }
    @Override
    public void setIndexno(int indexno) {
        this.indexno = indexno;
    }
    @Override
    public String getName() {
        return name;
    }
    @Override
    public void setName(String name) {
        this.name = name;
    }
}